package com.glsc.ngateway.common.base.domain.mysql.gateway.system;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.glsc.ngateway.common.base.domain.mysql.gateway.platform.Appendix;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

@Entity
@Data
@Table(name = "t_gw_system_main")
@org.hibernate.annotations.Table(appliesTo = "t_gw_system_main",comment = "信息系统主表")
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class SystemMain implements Serializable {

    @ApiModelProperty(value = "系统ID")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "op_id", columnDefinition = "int(11) comment '系统ID'")
    private Integer opId;

    @ApiModelProperty(value = "Gitee 项目id")
    @Column(name = "program_id", columnDefinition = "varchar(64) comment 'Gitee 项目id'")
    private String programId;

    @ApiModelProperty(value = "系统名称")
    @Column(name = "op_name", columnDefinition = "varchar(64) comment '系统名称'")
    private String opName;
//
//    @ApiModelProperty(value = "系统ID")
//    @Column(name = "op_style")
//    private Integer opStyle;

    @ApiModelProperty(value = "建设方式")
    @Column(name = "op_build", columnDefinition = "varchar(10) comment '建设方式'")
    private String opBuild;

    @ApiModelProperty(value = "供应商id")
    @Column(name = "op_support", columnDefinition = "int comment '供应商id'")
    private Integer opSupport;

    @ApiModelProperty(value = "供应商名称")
    @Transient
    private String opSupportName;

    @ApiModelProperty(value = "系统编号")
    @Column(name = "system_class_no", columnDefinition = "varchar(10) comment '系统编号'")
    private String systemClassNo;

    @ApiModelProperty(value = "系统大类")
    @Column(name = "main_class", columnDefinition = "varchar(10) comment '系统大类'")
    private String mainClass;

    @ApiModelProperty(value = "系统类别")
    @Column(name = "system_class", columnDefinition = "varchar(10) comment '系统类别'")
    private String systemClass;

    @ApiModelProperty(value = "系统功能描述")
    @Column(name = "system_summary", columnDefinition = "text comment '系统功能描述'")
    private String systemSummary;

    @ApiModelProperty(value = "重要性")
    @Column(name = "system_importance", columnDefinition = "varchar(30) comment '重要性'")
    private String systemImportance;

    @ApiModelProperty(value = "单个归口部门id")
    @Column(name = "belong_dept_id", columnDefinition = "varchar(20) comment '单个归口部门id'")
    private String belongDeptId;

    @ApiModelProperty(value = "信息系统对应项目信息")
    @Column(name = "project_id", columnDefinition = "varchar(20) comment '信息系统对应项目信息'")
    private String projectId;

    @ApiModelProperty(value = "状态")
    @Column(name = "status", columnDefinition = "varchar(2) comment '状态'")
    private String status;

    @ApiModelProperty(value = "系统开发语言")
    @Column(name = "system_develop_language", columnDefinition = "varchar(100) comment '系统开发语言'")
    private String systemDevelopLanguage;

    @ApiModelProperty(value = "保护等级")
    @Column(name = "protect_level", columnDefinition = "varchar(2) comment '保护等级'")
    private String protectLevel;

    @ApiModelProperty(value = "互联网访问")
    @Column(name = "internet_access", columnDefinition = "varchar(2) comment '互联网访问'")
    private String internetAccess;

    @ApiModelProperty(value = "业务类型")
    @Column(name = "business_type", columnDefinition = "varchar(2) comment '业务类型'")
    private String businessType;

    @ApiModelProperty(value = "域名")
    @Column(name = "domain", columnDefinition = "varchar(1024) comment '域名'")
    private String domain;

    @ApiModelProperty(value = "生产客户端或网页访问路径")
    @Column(name = "access_path", columnDefinition = "varchar(1024) comment '生产客户端或网页访问路径'")
    private String accessPath;

    @ApiModelProperty(value = "是否涉及公民个人信息数据")
    @Column(name = "person_data", columnDefinition = "varchar(2) comment '是否涉及公民个人信息数据'")
    private String personData;

    @ApiModelProperty(value = "是否定级备案")
    @Column(name = "is_level_record", columnDefinition = "varchar(2) comment '是否定级备案'")
    private String isLevelRecord;

    @ApiModelProperty(value = "网络安全保护等级")
    @Column(name = "net_protect_level", columnDefinition = "varchar(2) comment '网络安全保护等级'")
    private String netProtectLevel;

    @ApiModelProperty(value = "备案证号")
    @Column(name = "record_num", columnDefinition = "varchar(64) comment '备案证号'")
    private String recordNum;

    @ApiModelProperty(value = "系统上线时间")
    @Column(name = "online_time", columnDefinition = "varchar(64) comment '系统上线时间'")
    private String onlineTime;

    @ApiModelProperty(value = "购买费用")
    @Column(name = "purchase_cost", columnDefinition = "varchar(64) comment '购买费用'")
    private String purchaseCost;

    @ApiModelProperty(value = "操作人员账号")
    @Column(name = "op_operator", columnDefinition = "varchar(20) comment '操作人员账号'")
    private String opOperator;

    @ApiModelProperty(value = "操作人员姓名")
    @Column(name = "op_operator_name", columnDefinition = "varchar(20) comment '操作人员姓名'")
    private String opOperatorName;

    @ApiModelProperty(value = "系统标识，如amprod,ysp,glam,absmanage,glrm等")
    @Column(name = "system_id", columnDefinition = "varchar(64) comment '系统，如amprod,ysp,glam,absmanage,glrm等'")
    private String systemId;

    @Column(name = "insert_time", columnDefinition = "datetime comment '创建时间'")
    @org.hibernate.annotations.CreationTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    protected LocalDateTime insertTime;

    @Column(name = "update_time", columnDefinition = "datetime comment '更新时间'")
    @org.hibernate.annotations.UpdateTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    protected LocalDateTime updateTime;

    @ApiModelProperty(value = "项目经理oa列表")
    @Transient
    private List<String> memberManager;

    @ApiModelProperty(value = "项目经理名称列表")
    @Transient
    private List<String> memberManagerNameList;

    @ApiModelProperty(value = "系统管理员oa列表")
    @Transient
    private List<String> systemManager;

    @ApiModelProperty(value = "系统管理员名称列表")
    @Transient
    private List<String> systemManagerNameList;

    @ApiModelProperty(value = "运维管理员oa列表")
    @Transient
    private List<String> opsManager;

    @ApiModelProperty(value = "运维管理员名称列表")
    @Transient
    private List<String> opsManagerNameList;
//    @ApiModelProperty(value = "多个供应商code")
//    @Transient
//    private List<String> opSupport;
//
//    @ApiModelProperty(value = "多个供应商code")
//    @Transient
//    private List<String> opSupportName;

    @ApiModelProperty(value = "多个业务对口部门")
    @Transient
    private List<String> businessDepartment;

    @ApiModelProperty(value = "多个团队id")
    @Transient
    private List<String> opGroupId;

    @ApiModelProperty(value = "多个联系人id")
    @Transient
    private List<String> contactId;

    @ApiModelProperty(value = "多个联系人姓名")
    @Transient
    private List<String> contactName;

    @ApiModelProperty(value = "多个联系人信息")
    @Transient
    private List<SystemMainContact> contactInfo;

    @ApiModelProperty(value = "多个联系人信息")
    @Transient
    private SystemDoc systemDoc;

    @Transient
    private Integer operateFlag;


}
